
import type { BodyType } from './basic'

export const defaultWithIUi: IUi = {
  id: -1,
  moduleId: -1,
  environmentId: -1,
  databaseId: -1,
  assertion: '',
  type: '',
  engineType: 'UI',
  name: '默认名称',
  description: '无描述',
  level: 'p0',
  bodyType: 'JSON',
  sqlText: '',
  isRetry: false,
  retryType: "同步",
  retryCount: 1,
  retryFirstInterval: 3,
  createAccountId: '',
  updateAccountId: '',
  gmtCreate: new Date(),
  gmtModified: new Date(),
}

export interface IUi {
  id: number
  moduleId: number
  environmentId: number
  databaseId: number
  type: string
  engineType: string
  assertion: string
  name: string
  description?: string
  level: 'p0' | 'p1' | 'p2' | 'p3'
  bodyType: BodyType
  sqlText: string
  isRetry: boolean
  retryType: string
  retryCount: number
  retryFirstInterval: number
  createAccountId: string
  updateAccountId: string
  gmtCreate: Date
  gmtModified: Date
}



export const defaultWithIUIElement: IUIElement = {
  id: -1,
  moduleId: -1,
  name: '默认名称',
  description: '无描述',
  locationType: '',
  locationExpress: '',
  createAccountId: -1,
  updateAccountId: -1,
  gmtCreate: new Date(),
  gmtModified: new Date(),
}

export interface IUIElement {
  id: number
  moduleId: number
  name: string
  locationType: string
  locationExpress: string
  description: string
  createAccountId: number
  updateAccountId: number
  gmtCreate: Date
  gmtModified: Date
}

export interface IOperation {
  id: number
  category: string
  categoryName: string
  name: string
  value: string
  extend: string
  remark: null // waiting backend
}
